<div id="product">
	<div class="product-info">
		<div class="product-image">
			<img src="uploads/products/thumbs/<?php echo $product->images; ?>" width="306">
		</div>
		<div class="product-detail">
			<h3 class="title"><?php echo $product->name; ?></h3>
			<p class="product-id"><label>Mã hàng</label>: <?php echo $product->productId; ?></p>
			<p><label>Giá</label>: <span class="cost"><?php echo $product->price; ?></span></p>

			<span class="title">Đặc Điểm</span>
			<div class="description"><?php echo $product->description; ?></div>
			<?php if(strlen($product->fb) > 0) { ?>
			<div class="fb-like" style="margin: 5px 20px;" data-href="<?php echo $product->fb; ?>" data-layout="button_count" data-action="like" data-show-faces="false" data-share="false"></div>
			<?php } ?>
			<!-- AddThis Button BEGIN -->
			<div class="addthis_toolbox addthis_default_style " style="margin: 20px;">
				<a class="addthis_counter addthis_pill_style"></a>
				<a class="addthis_button_tweet"></a>				
			</div>
			<script type="text/javascript">var addthis_config = {"data_track_addressbar":true};</script>
			<script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-533ac85e65e8fa16"></script>
			<!-- AddThis Button END -->
			<div class="fb" style="margin: 20px;">
			<iframe src="//www.facebook.com/plugins/likebox.php?href=https%3A%2F%2Fwww.facebook.com%2Fmeoshophanghieuxuatkhau&amp;width=200&amp;height=290&amp;colorscheme=light&amp;show_faces=true&amp;header=true&amp;stream=false&amp;show_border=false&amp;appId=1434276260148369" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:300px; height:290px;" allowTransparency="true"></iframe>
			</div>
		</div>
		<div class="clear"></div>
	</div>
	<div class="product-view">
		<span class="title">Hình ảnh chi tiết</span>
		<ul>
			<?php foreach ($listImages as $key => $value) {  ?>
			<li><img src="uploads/products/images/<?php echo $value->image; ?>"><li>
			<?php } ?>
		</ul>
	</div>
</div>

<div id="fb-root"></div>
<script>(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return;
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/vi_VN/all.js#xfbml=1&appId=1434276260148369";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>


<?php 
if($showPopup) {
?>
<script type="text/javascript" src="assets/modal/jquery.modal.js"></script>
<link rel="stylesheet" type="text/css" href="assets/modal/jquery.modal.css" media="screen" />
<script type="text/javascript">
	$(document).ready(function() {
		var x = getCookie('popup');	
		if(x == "") {
			$("#popup").modal({
		        closeClass: 'icon-remove',
		        closeText: '!'
	      	});
		}


		$('.close-modal').click(function() {
			setCookie('popup', 'close', 7);
		})
	});

function setCookie(cname,cvalue,exdays)
{
	var d = new Date();
	d.setTime(d.getTime()+(exdays*24*60*60*1000));
	var expires = "expires="+d.toGMTString();
	document.cookie = cname + "=" + cvalue + "; " + expires + "; path=/";
}

function getCookie(cname)
{
	var name = cname + "=";
	var ca = document.cookie.split(';');
	for(var i=0; i<ca.length; i++)
	  {
	  var c = ca[i].trim();
	  if (c.indexOf(name)==0) return c.substring(name.length,c.length);
	  }
	return "";
} 
</script>
<style>
.modal {
	width: 600px;
}
</style>
<div class="modal" id="popup" style="display:none;">
	<a href="<?php echo $this->config->item('popup_link'); ?>" target="_blank" >
    	<img src="<?php echo $this->config->item('popup_image'); ?>" width="600"/>
    </a>
</div>

<?php
}
?>